import request from '@utils/request'
// 请求商品列表
const fetchCates = (params = {}) => request.get('/phone/salesThings', {
  params
})
// 请求分类数据
const fetchList = (params = {}) => request.get('/phone/getIconfont', {
  params
})
const fetchLists = (params = {}) => request.get('/phone/cateList', {
  params
})

const fetchDate = (params = {}) => request.get('/phone/SearChData', {
  params
})

const fetchDetails = (params = {}) => request.get('/phone/getDetail', {
  params
})
// 登录
const login = (userinfo) => request.post('phone/login', userinfo)
// 注册
const regist = (params = {}) => request.post('users/register', params)
// 用户地址
const getAddress = (params = {}) => request.post('phone/getAddress', params)
const addAddress = (params) => request.post('phone/Addaddress', params)

const getOneAddress = (params = {}) => request.get('/phone/GetOneaddress', {
  params
})
const updateAddress = (params = {}) => request.post('/phone/Updateaddress', params)

const deladdress = (params = {}) => request.post('/phone/Deladdress', params)
export {
  fetchCates,
  fetchList,
  fetchLists,
  fetchDate,
  fetchDetails,
  login,
  regist,
  getAddress,
  addAddress,
  getOneAddress,
  updateAddress,
  deladdress
}
